//
//  Login.m
//  hff4-7
//
//  Created by mac on 16-4-14.
//  Copyright (c) 2016年 ztt4-6. All rights reserved.
//

#import "Login.h"

@implementation Login
{
    NSString *name;
    NSString *passwd;
}
-(void)getName
{
    NSLog(@"请输入用户名：");
    char* na=malloc(20);
    scanf("%s",na);
    name=[[NSString alloc]initWithCString:na encoding:NSUTF8StringEncoding];
    [self getPasswd];
}

-(void)getPasswd
{
    NSLog(@"请输入密码：");
    char* pass=malloc(20);
    scanf("%s",pass);
    passwd=[[NSString alloc]initWithCString:pass encoding:NSUTF8StringEncoding];
    if ([name isEqualToString:@"fengzi"]&&[passwd isEqualToString:@"184526"])
    {
        NSLog(@"登录成功。");
        [self.delegata loginWinthName:name passwd:passwd success:YES];
    }
    else
    {
        NSLog(@"登录失败。");
        [self.delegata loginWinthName:name passwd:passwd success:NO];
    }
}
@end
